using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class CoveragePlanMap : EntityTypeConfiguration<CoveragePlan>
    {
        public CoveragePlanMap()
        {
            // Primary Key
            this.HasKey(t => t.Id);

            // Properties
            this.Property(t => t.Name)
                .IsRequired()
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("CoveragePlan");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.Name).HasColumnName("Name");
            this.Property(t => t.Percentage).HasColumnName("Percentage");
            this.Property(t => t.Currency).HasColumnName("Currency");
            this.Property(t => t.CP_CoPay).HasColumnName("CP_CoPay");
            this.Property(t => t.CP_Authorization).HasColumnName("CP_Authorization");
            this.Property(t => t.CP_PatientMaxPayPerBill).HasColumnName("CP_PatientMaxPayPerBill");
        }
    }
}
